package com.zm.demo.core.concurrent;

import org.junit.Ignore;
import org.junit.Test;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.SynchronousQueue;

import static java.lang.System.out;

/**
 * @author zoum
 * @create 2019/7/1 14:41
 */
@Ignore
public class SynchronousQueueTest {


    public static void main(String[] args) throws InterruptedException{
        SynchronousQueue<Integer> queue1 = new SynchronousQueue<>();
//        new Thread(() ->{
//            try {
//                queue1.put(1);
//                out.println("put: " + 1);
//            }catch (Exception e){
//
//            }
//        }).start();

        new Thread(() ->{
            try {
                Thread.sleep(5000L);
                out.println("take: " + queue1.take());
            }catch (Exception e){

            }
        }).start();


    }
}
